package com.cxd.web.backend;

import com.cxd.entity.EbUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/index")
public class IndexController {
//    @Autowired
//    private IEbProductService iEbProductService;

    @RequestMapping("/manage")
    public String manage(HttpSession session,Model model){
        Object user = session.getAttribute("lgnUser");
        if (user == null){
            return "redirect:/f-login/to_login";
        }
        EbUser ebUser = (EbUser) user;
        if(ebUser.getEuStatus()!=2){
            return "redirect:/f-index/index";
        }
        model.addAttribute("user",ebUser);
        //WEB-INF/manage/index.jsp
        model.addAttribute("tag",1);
        return "manage/index";
    }

}
